//
//  Language.swift
//  Stringz
//
//  Created by Heysem Katibi on 12/22/16.
//  Copyright © 2016 Heysem Katibi. All rights reserved.
//

import Foundation

/// The languages available in iOS system, Every File must have a language. Default: `Language.base`
enum Language: String, CaseIterable {
  case base = "Base"
  case afrikaans = "af"
  case albanian = "sq"
  case amharic = "am"
  case arabic = "ar"
  case armenian = "hy"
  case bambara = "bm"
  case bengali = "bn"
  case bislama = "bi"
  case bulgarian = "bg"
  case burmeseMyanmar = "my"
  case catalan = "ca"
  case cebuano = "ceb"
  case chewa = "ny"
  case chineseHongKong = "zh-HK"
  case chinesePRC = "zh-CN"
  case chineseSimplified = "zh-Hans"
  case chineseSimplifiedPRC = "zh-Hans-CN"
  case chineseTaiwan = "zh-TW"
  case chineseTraditional = "zh-Hant"
  case chineseTraditionalHongKong = "zh-Hant-HK"
  case chineseTraditionalTaiwan = "zh-Hant-TW"
  case chuukese = "chk"
  case croatian = "hr"
  case czech = "cs"
  case danish = "da"
  case dutch = "nl"
  case efik = "efi"
  case english = "en"
  case englishAustralia = "en-AU"
  case englishCanada = "en-CA"
  case englishIndia = "en-IN"
  case englishUK = "en-GB"
  case englishUS = "en-US"
  case estonian = "et"
  case fanti = "fat"
  case fijian = "fj"
  case filipino = "fil"
  case finnish = "fi"
  case fon = "fon"
  case french = "fr"
  case frenchCanada = "fr-CA"
  case frenchFrance = "fr-FR"
  case georgian = "ka"
  case german = "de"
  case greek = "el"
  case guarani = "gn"
  case haitianCreole = "ht"
  case hebrew = "he"
  case hiligaynon = "hil"
  case hindi = "hi"
  case hindiFiji = "hif"
  case hmong = "hmn"
  case hungarian = "hu"
  case iban = "iba"
  case icelandic = "is"
  case igbo = "ig"
  case iloko = "ilo"
  case indonesian = "id"
  case italian = "it"
  case japanese = "ja"
  case kamba = "kam"
  case kannada = "kn"
  case karenSgaw = "ksw"
  case kazakh = "kk"
  case kekchí = "kek"
  case khmer = "km"
  case kinyarwanda = "rw"
  case kiribatiGilbertese = "gil"
  case korean = "ko"
  case kosraean = "kos"
  case kurdishCentral = "ckb"
  case lao = "lo"
  case latvian = "lv"
  case lingala = "ln"
  case lithuanian = "lt"
  case macedonian = "mk"
  case malagasy = "mg"
  case malay = "ms"
  case malayalam = "ml"
  case maltese = "mt"
  case marshallese = "mh"
  case mongolian = "mn"
  case navajo = "nv"
  case nepali = "ne"
  case nivaclé = "cag"
  case norwegian = "no"
  case norwegianBokmal = "nb"
  case palauan = "pau"
  case persianFarsi = "fa"
  case pohnpeian = "pon"
  case polish = "pl"
  case portuguese = "pt"
  case portugueseBrazil = "pt-BR"
  case portuguesePortugal = "pt-PT"
  case romanian = "ro"
  case russian = "ru"
  case samoan = "sm"
  case serbian = "sr"
  case shona = "sn"
  case sinhala = "si"
  case slovak = "sk"
  case slovenian = "sl"
  case sothoSouthern = "st"
  case spanish = "es"
  case spanishLatinAmerica = "es-419"
  case spanishMexico = "es-MX"
  case spanishSpain = "es-ES"
  case spanishUS = "es-US"
  case swahili = "sw"
  case swati = "ss"
  case swedish = "sv"
  case tagalog = "tl"
  case tahitian = "ty"
  case tamil = "ta"
  case telugu = "te"
  case thai = "th"
  case tokPisin = "tpi"
  case tongan = "to"
  case tshiluba = "lua"
  case tswana = "tn"
  case turkish = "tr"
  case twi = "tw"
  case ukrainian = "uk"
  case urdu = "ur"
  case vietnamese = "vi"
  case welsh = "cy"
  case xhosa = "xh"
  case yapese = "yap"
  case yoruba = "yo"
  case zulu = "zu"
  
  /// Returns a friendly name for the language to be displayed in the table view.
  var fiendlyName: String {
    switch self {
    case .base: return "Base"
    case .afrikaans: return "Afrikaans"
    case .albanian: return "Albanian"
    case .amharic: return "Amharic"
    case .arabic: return "Arabic"
    case .armenian: return "Armenian"
    case .bambara: return "Bambara"
    case .bengali: return "Bengali"
    case .bislama: return "Bislama"
    case .bulgarian: return "Bulgarian"
    case .burmeseMyanmar: return "Burmese (Myanmar)"
    case .catalan: return "Catalan"
    case .cebuano: return "Cebuano"
    case .chewa: return "Chewa"
    case .chineseHongKong: return "Chinese (Hong Kong)"
    case .chinesePRC: return "Chinese (PRC)"
    case .chineseSimplified: return "Chinese (Simplified)"
    case .chineseSimplifiedPRC: return "Chinese (Simplified, China)"
    case .chineseTaiwan: return "Chinese (Taiwan)"
    case .chineseTraditional: return "Chinese (Traditional)"
    case .chineseTraditionalHongKong: return "Chinese (Traditional, Hong Kong)"
    case .chineseTraditionalTaiwan: return "Chinese (Traditional, Taiwan)"
    case .chuukese: return "Chuukese"
    case .croatian: return "Croatian"
    case .czech: return "Czech"
    case .danish: return "Danish"
    case .dutch: return "Dutch"
    case .efik: return "Efik"
    case .english: return "English"
    case .englishAustralia: return "English (Australia)"
    case .englishCanada: return "English (Canada)"
    case .englishIndia: return "English (India)"
    case .englishUK: return "English (UK)"
    case .englishUS: return "English (US)"
    case .estonian: return "Estonian"
    case .fanti: return "Fanti"
    case .fijian: return "Fijian"
    case .filipino: return "Filipino"
    case .finnish: return "Finnish"
    case .fon: return "Fon"
    case .french: return "French"
    case .frenchCanada: return "French (Canada)"
    case .frenchFrance: return "French (France)"
    case .georgian: return "Georgian"
    case .german: return "German"
    case .greek: return "Greek"
    case .guarani: return "Guarani"
    case .haitianCreole: return "Haitian Creole"
    case .hebrew: return "Hebrew"
    case .hiligaynon: return "Hiligaynon"
    case .hindi: return "Hindi"
    case .hindiFiji: return "Hindi (Fiji)"
    case .hmong: return "Hmong"
    case .hungarian: return "Hungarian"
    case .iban: return "Iban"
    case .icelandic: return "Icelandic"
    case .igbo: return "Igbo"
    case .iloko: return "Iloko"
    case .indonesian: return "Indonesian"
    case .italian: return "Italian"
    case .japanese: return "Japanese"
    case .kamba: return "Kamba"
    case .kannada: return "Kannada"
    case .karenSgaw: return "Karen (S’gaw)"
    case .kazakh: return "Kazakh"
    case .kekchí: return "Kekchí"
    case .khmer: return "Khmer"
    case .kinyarwanda: return "Kinyarwanda"
    case .kiribatiGilbertese: return "Kiribati (Gilbertese)"
    case .korean: return "Korean"
    case .kosraean: return "Kosraean"
    case .kurdishCentral: return "Kurdish (Central)"
    case .lao: return "Lao"
    case .latvian: return "Latvian"
    case .lingala: return "Lingala"
    case .lithuanian: return "Lithuanian"
    case .macedonian: return "Macedonian"
    case .malagasy: return "Malagasy"
    case .malay: return "Malay"
    case .malayalam: return "Malayalam"
    case .maltese: return "Maltese"
    case .marshallese: return "Marshallese"
    case .mongolian: return "Mongolian"
    case .navajo: return "Navajo"
    case .nepali: return "Nepali"
    case .nivaclé: return "Nivaclé"
    case .norwegian: return "Norwegian"
    case .norwegianBokmal: return "Norwegian Bokmål"
    case .palauan: return "Palauan"
    case .persianFarsi: return "Persian (Farsi)"
    case .pohnpeian: return "Pohnpeian"
    case .polish: return "Polish"
    case .portuguese: return "Portuguese"
    case .portugueseBrazil: return "Portuguese (Brazil)"
    case .portuguesePortugal: return "Portuguese (Portugal)"
    case .romanian: return "Romanian"
    case .russian: return "Russian"
    case .samoan: return "Samoan"
    case .serbian: return "Serbian"
    case .shona: return "Shona"
    case .sinhala: return "Sinhala"
    case .slovak: return "Slovak"
    case .slovenian: return "Slovenian"
    case .sothoSouthern: return "Sotho (Southern)"
    case .spanish: return "Spanish"
    case .spanishLatinAmerica: return "Spanish (Latin America)"
    case .spanishMexico: return "Spanish (Mexico)"
    case .spanishSpain: return "Spanish (Spain)"
    case .spanishUS: return "Spanish (US)"
    case .swahili: return "Swahili"
    case .swati: return "Swati"
    case .swedish: return "Swedish"
    case .tagalog: return "Tagalog"
    case .tahitian: return "Tahitian"
    case .tamil: return "Tamil"
    case .telugu: return "Telugu"
    case .thai: return "Thai"
    case .tokPisin: return "Tok Pisin"
    case .tongan: return "Tongan"
    case .tshiluba: return "Tshiluba"
    case .tswana: return "Tswana"
    case .turkish: return "Turkish"
    case .twi: return "Twi"
    case .ukrainian: return "Ukrainian"
    case .urdu: return "Urdu"
    case .vietnamese: return "Vietnamese"
    case .welsh: return "Welsh"
    case .xhosa: return "Xhosa"
    case .yapese: return "Yapese"
    case .yoruba: return "Yoruba"
    case .zulu: return "Zulu"
    }
  }

  /// Returns the flag of the country in which the language is mostly used.
  var flag: String {
    switch self {
    case .afrikaans: return "🇿🇦"
    case .albanian: return "🇦🇱"
    case .amharic: return "🇪🇹"
    case .arabic: return "🇸🇦"
    case .armenian: return "🇦🇲"
    case .bambara: return "🇲🇱"
    case .base: return "🏁"
    case .bengali: return "🇮🇳"
    case .bislama: return "🇻🇺"
    case .bulgarian: return "🇧🇬"
    case .burmeseMyanmar: return "🇲🇲"
    case .catalan: return "🇪🇸"
    case .cebuano: return "🇵🇭"
    case .chewa: return "🇲🇼"
    case .chineseHongKong: return "🇭🇰"
    case .chinesePRC: return "🇨🇳"
    case .chineseSimplified: return "🇨🇳"
    case .chineseSimplifiedPRC: return "🇨🇳"
    case .chineseTaiwan: return "🇹🇼"
    case .chineseTraditional: return "🇹🇼"
    case .chineseTraditionalHongKong: return "🇭🇰"
    case .chineseTraditionalTaiwan: return "🇹🇼"
    case .chuukese: return "🇫🇲"
    case .croatian: return "🇭🇷"
    case .czech: return "🇨🇿"
    case .danish: return "🇩🇰"
    case .dutch: return "🇳🇱"
    case .efik: return "🇳🇬"
    case .english: return "🇺🇸"
    case .englishAustralia: return "🇦🇺"
    case .englishCanada: return "🇨🇦"
    case .englishIndia: return "🇮🇳"
    case .englishUK: return "🇬🇧"
    case .englishUS: return "🇺🇸"
    case .estonian: return "🇪🇪"
    case .fanti: return "🇬🇭"
    case .fijian: return "🇫🇯"
    case .filipino: return "🇵🇭"
    case .finnish: return "🇫🇮"
    case .fon: return "🇧🇯"
    case .french: return "🇫🇷"
    case .frenchCanada: return "🇨🇦"
    case .frenchFrance: return "🇫🇷"
    case .georgian: return "🇬🇪"
    case .german: return "🇩🇪"
    case .greek: return "🇬🇷"
    case .guarani: return "🇵🇾"
    case .haitianCreole: return "🇭🇹"
    case .hebrew: return "🇮🇱"
    case .hiligaynon: return "🇵🇭"
    case .hindi: return "🇮🇳"
    case .hindiFiji: return "🇫🇯"
    case .hmong: return "🇨🇳"
    case .hungarian: return "🇭🇺"
    case .iban: return "🇧🇳"
    case .icelandic: return "🇮🇸"
    case .igbo: return "🇳🇬"
    case .iloko: return "🇵🇭"
    case .indonesian: return "🇮🇩"
    case .italian: return "🇮🇹"
    case .japanese: return "🇯🇵"
    case .kamba: return "🇰🇪"
    case .kannada: return "🇮🇳"
    case .karenSgaw: return "🇲🇲"
    case .kazakh: return "🇰🇿"
    case .kekchí: return "🇬🇹"
    case .khmer: return "🇰🇭"
    case .kinyarwanda: return "🇷🇼"
    case .kiribatiGilbertese: return "🇰🇮"
    case .korean: return "🇰🇷"
    case .kosraean: return "🇫🇲"
    case .kurdishCentral: return "🇮🇶"
    case .lao: return "🇱🇦"
    case .latvian: return "🇱🇻"
    case .lingala: return "🇨🇩"
    case .lithuanian: return "🇱🇹"
    case .macedonian: return "🇲🇰"
    case .malagasy: return "🇲🇬"
    case .malay: return "🇲🇾"
    case .malayalam: return "🇮🇳"
    case .maltese: return "🇲🇹"
    case .marshallese: return "🇲🇭"
    case .mongolian: return "🇲🇳"
    case .navajo: return "🇺🇸"
    case .nepali: return "🇳🇵"
    case .nivaclé: return "🇵🇾"
    case .norwegian: return "🇳🇴"
    case .norwegianBokmal: return "🇳🇴"
    case .palauan: return "🇵🇼"
    case .persianFarsi: return "🇮🇷"
    case .pohnpeian: return "🇫🇲"
    case .polish: return "🇷🇺"
    case .portuguese: return "🇵🇹"
    case .portugueseBrazil: return "🇧🇷"
    case .portuguesePortugal: return "🇵🇹"
    case .romanian: return "🇷🇴"
    case .russian: return "🇷🇺"
    case .samoan: return "🇼🇸"
    case .serbian: return "🇷🇸"
    case .shona: return "🇿🇼"
    case .sinhala: return "🇱🇰"
    case .slovak: return "🇸🇰"
    case .slovenian: return "🇸🇮"
    case .sothoSouthern: return "🇱🇸"
    case .spanish: return "🇪🇸"
    case .spanishLatinAmerica: return "🇨🇴"
    case .spanishMexico: return "🇲🇽"
    case .spanishSpain: return "🇪🇸"
    case .spanishUS: return "🇺🇸"
    case .swahili: return "🇹🇿"
    case .swati: return "🇵🇰"
    case .swedish: return "🇸🇪"
    case .tagalog: return "🇵🇭"
    case .tahitian: return "🇵🇫"
    case .tamil: return "🇮🇳"
    case .telugu: return "🇮🇳"
    case .thai: return "🇹🇭"
    case .tokPisin: return "🇵🇬"
    case .tongan: return "🇹🇴"
    case .tshiluba: return "🇨🇩"
    case .tswana: return "🇧🇼"
    case .turkish: return "🇹🇷"
    case .twi: return "🇬🇭"
    case .ukrainian: return "🇺🇦"
    case .urdu: return "🇵🇰"
    case .vietnamese: return "🇻🇳"
    case .welsh: return "🏴󠁧󠁢󠁷󠁬󠁳󠁿"
    case .xhosa: return "🇿🇦"
    case .yapese: return "🇫🇲"
    case .yoruba: return "🇳🇬"
    case .zulu: return "🇿🇦"
    }
  }
}

extension Language: Comparable {
  static func < (lhs: Language, rhs: Language) -> Bool {
    return lhs.rawValue < rhs.rawValue
  }
}
